const jwt = require('jsonwebtoken');
module.exports={
    stoken :(name,key,timeout)=>{
        return  jwt.sign(
            {name:name},
            key
        , { expiresIn:timeout});
    },
    jtoken :(token,key)=>{
        var res = ''
        jwt.verify(token,key, (err, decode)=> {
           if(err){
            res =  {status:10010}
           }else{
            res ={status:10000}
           }
        })
        return res
    }

}
